package com.atcumt.bytedance;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;

/**
 * 4
 * 6
 * 3 5 1 4 6 6
 * 3
 * 1 2 3
 * 4
 * 1 3 3 4
 * 6
 * 1 6 3 4 5 6
 */
public class Main02 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int t = scanner.nextInt();
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int[] nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = scanner.nextInt();
            }

            int res = 0;
            Map<Integer, Integer> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                map.put(nums[i] - i, map.getOrDefault(nums[i] - i, 0) + 1);
            }
            Iterator<Map.Entry<Integer, Integer>> iterator = map.entrySet().iterator();
            while (iterator.hasNext()) {
                Map.Entry<Integer, Integer> next = iterator.next();
                res += (next.getValue()*(next.getValue() - 1)) /2;
            }
            System.out.println(res);
        }
    }
}

